<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>制定物料组成设计单</title>
    <link rel="stylesheet" href="../../css/pintuer.css">
    <link rel="stylesheet" href="../../css/admin.css">
    <link rel="stylesheet" href="../../css/bootstrap.css">
    <style>
        input{
            border-top: none;
            border-left: none;
            border-right: none;
            border-bottom: black solid 1px;
        }
        table{
            border: 1px;
            cell-padding:0;
            cell-spacing:0;
            width: 80%;
            margin-top: 20px;
        }
        table thead{
            background-color:#b3d7ff ;
        }
        a{
            cursor: pointer;
        }
    </style>
</head>
<body>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/bootstrap-table1.15.3.js"></script>
<script>
    $(function () {
        $.ajax({
            url:'/dFile/materielSelect.action',
            type:'get',
            dataType:'json',
            data:'type=Y001-1',
            success:function (data) {
                var tb = $('#tb_com');
                tb.empty();
                for( var i=0;i<data.length;i++){
                    var tr=$("<tr>");

                    var PID = $("<td>");
                    var a = $("<a id='"+data[i].PRODUCT_ID+"' class='queryDFileById'>").text(data[i].PRODUCT_ID);
                    PID.append(a);
                    tr.append(PID);

                    var pname =$("<td>").text(data[i].PRODUCT_NAME);
                    tr.append(pname);

                    var jibie = $('<td>').text(data[i].PRODUCT_CLASS==="D001-1"?"高档":(data[i].PRODUCT_CLASS==="D001-2"?"中档":"低档"));
                    tr.append(jibie);


                    var itype = $('<td>').text(data[i].FIRST_KIND_NAME);
                    tr.append(itype);

                    var iitype = $("<td>").text(data[i].SECOND_KIND_NAME);
                    tr.append(iitype);

                    var iiitype = $("<td>").text(data[i].THIRD_KIND_NAME);
                    tr.append(iiitype);

                    var type = $('<td>').text(data[i].TYPE==="Y001-1"?"商品":"物料");
                    tr.append(type);

                    var t = $("<td>");
                    var a = $("<a href='design_module.html?id="+data[i].PRODUCT_ID+"' style='color: #33bbdd;'>").text("制定设计单");
                    t.append(a);
                    tr.append(t);

                    tb.append(tr);

                }
            }
        })
        $(document).on("click",".queryDFileById",function () {
            var id=$(this).attr("id");
            $.ajax({
                url:'/dFile/selectByPID.action',
                data: 'id='+id,
                dataType: 'json',
                type: 'post',
                success:function (data) {
                    $("#composite").modal("show");
                    $('span[name="PRODUCT_ID"]').text(data.PRODUCT_ID);
                    $("span[name='PRODUCT_NAME']").text(data.PRODUCT_NAME);
                    $("span[name='FACTORY_NAME']").text(data.FACTORY_NAME);
                    $('span[name="FIRST_KIND_NAME"]').text(data.FIRST_KIND_NAME);
                    $('span[name="SECOND_KIND_NAME"]').text(data.SECOND_KIND_NAME);
                    $('span[name="THIRD_KIND_NAME"]').text(data.THIRD_KIND_NAME);
                    $('span[name="PRODUCT_NICK"]').text(data.PRODUCT_NICK);
                    $('span[name="TYPE"]').text(data.TYPE);
                    $('span[name="PRODUCT_CLASS"]').text(data.PRODUCT_CLASS)
                    $('span[name="PERSONAL_UNIT"]').text(data.PERSONAL_UNIT);
                    $('span[name="PERSONAL_textUE"]').text(data.PERSONAL_textUE);
                    $('span[name="LIST_PRICE"]').text(data.LIST_PRICE);
                    $('span[name="COST_PRICE"]').text(data.COST_PRICE);
                    $('span[name="REAL_COST_PRICE"]').text(data.REAL_COST_PRICE);
                    $('span[name="WARRANTY"]').text(data.WARRANTY);
                    $('span[name="TWIN_NAME"]').text(data.TWIN_NAME);
                    $('span[name="TWIN_ID"]').text(data.TWIN_ID);
                    $('span[name="LIFECYCLE"]').text(data.LIFECYCLE);
                    $('span[name="AMOUNT_UNIT"]').text(data.AMOUNT_UNIT);
                    $('textarea[name="PROVIDER_GROUP"]').val(data.PROVIDER_GROUP);
                    $('textarea[name="PRODUCT_DESCRIBE"]').val(data.PRODUCT_DESCRIBE);
                    $('span[name="REGISTER"]').text(data.REGISTER);
                    $('span[name="REGISTER_TIME"]').text(data.REGISTER_TIME);
                    $('span[name="CHECK_TAG"]').text(data.CHECK_TAG);
                    $('span[name="DELETE_TAG"]').text(data.DELETE_TAG);
                    $("span[name='DESIGN_MODULE_TAG']").text(data.DESIGN_MODULE_TAG);
                    $('span[name="DESIGN_PROCEDURE_TAG"]').text(data.DESIGN_PROCEDURE_TAG);
                    $('span[name="DESIGN_CELL_TAG"]').text(data.DESIGN_CELL_TAG);
                    $('span[name="ID"]').text(data.ID);

                    $('select[name="RESPONSIBL_PERSON"]').val(data.RESPONSIBL_PERSON);
                    $('span[name="CHECKER"]').text(data.CHECKER);
                    $('span[name="CHECK_TIME"]').text(data.CHECK_TIME);
                    $('span[name="CHANGE_TIME"]').text(data.CHANGE_TIME);
                    $('span[name="FILE_CHANGE_AMOUNT"]').text(data.FILE_CHANGE_AMOUNT);

                }
            });
        })

    })

</script>
<table style="text-align: center;" class="table table-bordered table-hover table-striped table-condensed">
    <thead>
    <tr>
        <th>产品编号</th>
        <th>产品名称</th>
        <th>档次级别</th>
        <th>I级分类</th>
        <th>II级分类</th>
        <th>III级分类</th>
        <th>用途类型</th>
        <th>制定设计单</th>
    </tr>
    </thead>
    <tbody id="tb_com">
    </tbody>
</table>
<div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id="composite">
    <div class="modal-dialog" style="width: 80%;background-color: #d1ecf1;">

        <div class="modal-content" style="border: 1px solid black;">

            <div class="modal-header" style="height: 20%;">
                <h5>产品档案</h5>
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-right: 0px"></button>
            </div>

            <div class="modal-body">
                <form id="frm">
                    <input type="hidden" name="ID">
                    <input type="hidden" name="CHECK_TAG">
                    <input type="hidden" name="DELETE_TAG">
                    <input type="hidden" name="DESIGN_MODULE_TAG">
                    <input type="hidden" name="DESIGN_PROCEDURE_TAG">
                    <input type="hidden" name="DESIGN_CELL_TAG">

                    <table width="80%"  style="border-collapse:separate; border-spacing:0px 10px;">
                        <tr>
                            <td>产品编号：</td>
                            <td colspan="3"><span type="text" style="background-color: white;" readonly name="PRODUCT_ID"></span></td>
                        </tr>
                        <tr>
                            <td colspan="4"><div style="margin: 0px;padding: 0px; background-color: #09c"><span style="color: #eeffff">主信息</span></div></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">产品名称：</span></td>
                            <td><span type="text" name="PRODUCT_NAME"></span></td>
                            <td><span style="color: black;">制造商：</span></td>
                            <td><span type="text" name="FACTORY_NAME"></span></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">I级分类：</span></td>
                            <td><span readonly="readonly" name="FIRST_KIND_NAME"></span></td>
                            <td><span style="color: black;">II级分类：</span></td>
                            <td><span readonly="readonly" name="SECOND_KIND_NAME"></span></td>
                        </tr>

                        <tr>
                            <td><span style="color: black;">III级分类：</span></td>
                            <td><span readonly="readonly" name="THIRD_KIND_NAME"/></td>
                            <td><span style="color: black;">产品简称：</span></td>
                            <td><span type="text" name="PRODUCT_NICK"/></td>
                        </tr>

                        <tr>
                            <td><span style="color: black;">用途类型：</span></td>
                            <td><select name="TYPE">
                                <option value="Y001-1">商品</option>
                                <option value="Y001-2">物料</option>
                            </select></td>
                            <td><span style="color: black;">档次级别：</span></td>
                            <td><select name="PRODUCT_CLASS">
                                <option value="D001-1">高档</option>
                                <option value="D001-2">中档</option>
                                <option value="D001-3">低档</option>
                            </select></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">计量单位：</span></td>
                            <td><span type="text" name="PERSONAL_UNIT"></span></td>
                            <td><span style="color: black;">计量值：</span></td>
                            <td><span type="text" name="PERSONAL_VALUE"></span></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">市场单价（元）：</span></td>
                            <td><span type="text" name="LIST_PRICE"></span></td>
                            <td><span style="color: black;">计划成本单价（元）：</span></td>
                            <td><span type="text" name="COST_PRICE"></span></td>
                        </tr>
                        <!--<tr>
                            <td colspan="4"><div style="margin: 0px;padding: 0px; background-color: #09c"><span style="color: #eeffff">辅助信息</span></div></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">保修期：</span></td>
                            <td><input type="text" name="WARRANTY"></td>
                            <td><span style="color: black;">替代品名称：</span></td>
                            <td><input type="text" name="TWIN_NAME"></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">替代品编号：</span></td>
                            <td><input type="text" name="TWIN_ID"></td>
                            <td><span style="color: black;">生命周期（年）：</span></td>
                            <td><input type="text" name="LIFECYCLE"></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">单位：</span></td>
                            <td><input type="text" name="AMOUNT_UNIT"></td>
                            <td><span style="color: black;">产品经理：</span></td>
                            <td><input readonly="readonly" name="RESPONSIBL_PERSON"></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">供应商集合：</span></td>
                            <td><textarea  name="PROVIDER_GROUP"></textarea></td>
                            <td><span style="color: black;">产品描述：</span></td>
                            <td><textarea  name="PRODUCT_DESCRIBE"></textarea></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">登记人：</span></td>
                            <td><input type="text"  name="REGISTER"/></td>
                            <td><span style="color: black;">复核时间：</span></td>
                            <td><input type="text" name="CHECK_TIME"/></td>
                        </tr>
                        <tr>
                            <td><span style="color: black;">复核人：</span></td>
                            <td colspan="2"><input type="text"  name="CHECKER"/></td>

                        </tr>-->
                    </table>
                </form>

            </div>

        </div>
    </div>
</div>
</body>
</html>